package com.cloud.ribbon.controller;

import com.cloud.ribbon.service.HelloFegin;
import com.cloud.ribbon.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 奶茶
 * Created by on 2018/3/19.
 */
@RestController
public class HelloController {

    @Autowired
    private HelloService helloService;
    @Autowired
    private HelloFegin helloFegin;

    @RequestMapping(value = "/hi")
    public String hi(@RequestParam String name){
        return helloService.hiService(name);
    }

    /**
     * 调用feign提供的服务  用于服务链路测试
     * @param name
     * @return
     */
    @RequestMapping(value = "/hiFeign",method = RequestMethod.GET)
    public String hiFeign(@RequestParam String name){
        return helloFegin.hiService(name);
    }
}
